package com.xxwy.cloudsimpleconsumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author xxwy
 * on 2018/8/15 0015
 */
@RestController
public class ConsumerController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/buy")
    public String buyTicket(){
        return "xxwy"+restTemplate.getForObject("http://PROVIDER-TICKET/ticket",String.class);
    }
}
